<!DOCTYPE html>
<head>
    <meta charset='utf-8'/>
    <title>www.layabox.com</title>
    <meta name='apple-mobile-web-app-capable' content='yes' />
    <meta name='full-screen' content='true' />
    <meta name='screen-orientation' content='portrait' />
    <meta name='x5-fullscreen' content='true' />
    <meta name='360-fullscreen' content='true' />
    <meta http-equiv='expires' content='0' />
    <meta name='laya' logoimg='logo.png' logobkcolor='#ffffff' screenorientation='landscape' cacheid='fffffffff' />
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
</head>
<body style="background-color: #000;" onload="init()">
    <!-- protocol buffer -->
    <!--<script type="text/javascript" src="../../../bin/js/libs/bytebuffer.js"></script>-->
    <!--<script type="text/javascript" src="../../../bin/js/libs/protobuf.js"></script>-->
    <!-- libraries -->
    
    <!--<script src="../../../bin/js/libs/matter.js"></script>-->
	<script src="../../../bin/js/libs/laya.core.js"></script>
    <!--<script src="../../../bin/js/libs/matter-RenderLaya.js"></script>-->
    <script src="../../../bin/js/libs/laya.webgl.js"></script>
    <script src="../../../bin/js/libs/laya.filter.js"></script>
    <script src="../../../bin/js/libs/laya.particle.js"></script>
    <script src="../../../bin/js/libs/laya.ani.js"></script>
    <script src="../../../bin/js/libs/laya.ui.js"></script>
    <script src="../../../bin/js/libs/laya.html.js"></script>
    <script src="../../../bin/js/libs/laya.tiledmap.js"></script>
	<script src="../../../bin/js/libs/laya.d3.js"></script>
    <script src="../../../bin/js/libs/laya.pathfinding.js"></script>
    <script src="../../../bin/js/libs/laya.d3Plugin.js"></script>
    <script src="common/CameraMoveScript.js"></script>
    <script src="common/SkySampleScript.js"></script>
    <!-- demos -->
    <script id="jsCtrl"></script>
    <div style="position: absolute; left: 150px; top: 0px; z-index: 999999">
        <span style="color:#ff0000">左右箭头键切换</span>
        <select id="select" onChange="selectChanged()">
            <option>StaticModel_MeshSample</option>
            <option>StaticModel_SkyBoxSample</option>
            <option>StaticModel_HierarchySample</option>
            <option>StaticModel_InstantiateSample</option>
            <option>SkinAnimation_MultiActionSample</option>
            <option>SkinAnimation_MultiMeshSample</option>
            <option>SkinAnimation_MultiSubMeshSample</option>
            <option>ScriptAndCameraSample</option>
            <option>LightAndMaterialSample</option>
            <option>Materil_Reflect</option>
            <option>Material_NormalMap</option>
            <option>Camera_Ortho_2DMix3D_Sample</option>
            <option>StaticModel_3DSpaceTo2DSpace</option>
            <option>StaticModel_MeshTerrainSample</option>
            <option>RigitAnimationSample</option>
            <option>Camera_MultiCamera</option>
            <option>TargetTexture</option>
            <option>ResourceLoadAndDispose</option>
            <option>SkinAnimation_3DoverWeb</option>
        </select>
    </div>
    <script>
    var jsCtrl,select,type;
    function init(){
    jsCtrl = document.getElementById("jsCtrl");
    select = document.getElementById("select");
    type = GetQueryString("type");
    type = type || "StaticModel_MeshSample";
    select.value = type;
    jsCtrl.src="primaryStage/D3Base_"+type+".js";
    document.onkeyup = function(e){
    var keycode = e.which;
    if(keycode==37){
    if(select.selectedIndex>0)
    select.selectedIndex--;
    else
    select.selectedIndex = select.options.length-1;
    }else if(keycode == 39){
    if(select.selectedIndex<select.options.length-1)
        select.selectedIndex++;
        else
        select.selectedIndex = 0;
        }
        selectChanged();
        }
        }
        function selectChanged(){
        if(type !=select.value){
        window.location.href = window.location.pathname+"?type="+select.value;
        }
        }
        function GetQueryString(name){
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
        }
        </script>
    </body>
</html>